import java.util.Scanner;

public class Factor {
    //用递归的方式求阶乘,手动输入想求的数字的阶乘
    public static int fac(int n){
        if(n == 1){
            return 1;
        }
        int tmp = n * fac(n-1);
        return tmp;
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请问你要求几的阶乘？");
        int n = scanner.nextInt();
        System.out.println(fac(n));
    }
}
